import React from "react";
import ReactDOM from "react-dom";
import registerServiceWorker from "./registerServiceWorker";
import { store } from "./store/createStore.js";
import { Provider } from "react-redux";
import "./util/rem.js";
import "./assets/css/mixin.scss";
import { AppContainer } from "react-hot-loader";
import Router from "./router";

const render = Router => {
    ReactDOM.render(
        <AppContainer>
            <Provider store={store}>
                <Router />
            </Provider>
        </AppContainer>,
        document.getElementById("root")
    );
};
render(Router);
registerServiceWorker();

if (module.hot) {
    module.hot.accept("./router", () => {
        // if you are using harmony modules ({modules:false})
        render(Router);
    });
}
